package com.dhcc.thymeleaf.controller;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.dhcc.thymeleaf.entity.OaEmail;
import com.dhcc.thymeleaf.vo.Email;
import com.dhcc.thymeleaf.vo.Result;
import com.dhcc.thymeleaf.vo.User;

/**
* <p>标题: MailController.java</p>
* <p>业务描述:健康管理平台</p>
* <p>公司:东华软件股份公司</p>
* <p>版权:dhcc2013</p>
* @author 胡凯
* @date 2019年8月12日
* @version V1.0 
*/
@RestController
@RequestMapping("mail")
public class MailController {

	@RequestMapping("/list")
	public Result postMethodName(Email mail) {
		List<OaEmail> list = new ArrayList<OaEmail>();
		for(int i=0;i<11;i++) {
			OaEmail oaEmail = new OaEmail();
			oaEmail.setId(i);
			oaEmail.setContent("邮件"+i);
			oaEmail.setSendTime(new Date());
			oaEmail.setSubject("测试"+i);
			oaEmail.setTemplate("");
			oaEmail.setReceiveEmail("1"+i+"00987@qq.com");
			list.add(oaEmail);
		}
		return Result.ok(list);
	}
	@RequestMapping("/free")
	public ModelAndView showFreeMarker() {
		User user=new User();
		user.setName("cm123");
		user.setAge("23");
		user.setPassword("321654");
		user.setBirthday(new Date());
		ModelAndView mav = new ModelAndView("/freemarker/index");
		mav.addObject("user",user);
		return mav;
	}
}
